CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )

PROJECT( MefoolLib )

SET	(	SOURCES
		MefoolCriticalSectionEnterer.h
		MefoolCriticalSectionEnterer.cpp
		MefoolCOMObjectSharedPtr.h
		MefoolCOMObjectSharedPtr.cpp
		
		MefoolMemoryBuffer.h
		MefoolMemoryBuffer.cpp
		MefoolImageFormat.h
		MefoolImageFormat.cpp
		MefoolImage.h
		MefoolImage.cpp
		MefoolImageConverter.h
		MefoolImageConverter.cpp
		MefoolCapturedImage.h
		MefoolCapturedImage.cpp
		MefoolCaptureSettings.h
		MefoolCaptureSettings.cpp
		
		MefoolDeviceInternals.h
		MefoolDeviceInternals.cpp
		MefoolDevice.h
		MefoolDevice.cpp
		MefoolDeviceManager.h
		MefoolDeviceManager.cpp
	)	
	
IF( MSVC )
	# Set Unicode as character set for Visual Studio projects. By default it's Multi-Byte
	ADD_DEFINITIONS(-DUNICODE -D_UNICODE)
			
	# Set Warning level to 4
	IF ( CMAKE_CXX_FLAGS MATCHES "/W[0-4]" )
		STRING( REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" )
	ELSE()
		SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4" )
   ENDIF()
ENDIF()

SET( WINDOWS_SDK_PATH "C:/Program Files/Microsoft SDKs/Windows/v7.1" )

IF ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
	MESSAGE("Using Win64 Windows SDK")
	INCLUDE_DIRECTORIES( ${WINDOWS_SDK_PATH}/Include ) 
	SET( WINDOWS_SDK_LIBS_PATH ${WINDOWS_SDK_PATH}/Lib/x64 )
ELSE()
	MESSAGE("Using Win32 Windows SDK")
	INCLUDE_DIRECTORIES( ${WINDOWS_SDK_PATH}/Include ) 
	SET( WINDOWS_SDK_LIBS_PATH ${WINDOWS_SDK_PATH}/Lib )
ENDIF()

ADD_LIBRARY( ${PROJECT_NAME} STATIC ${SOURCES} )

# http://msdn.microsoft.com/en-us/library/windows/desktop/ee663600(v=vs.85).aspx
TARGET_LINK_LIBRARIES(	${PROJECT_NAME} 
					  # ${WINDOWS_SDK_LIBS_PATH}/evr.lib	# Not needed
						${WINDOWS_SDK_LIBS_PATH}/mf.lib
						${WINDOWS_SDK_LIBS_PATH}/mfplat.lib
						${WINDOWS_SDK_LIBS_PATH}/mfuuid.lib
						${WINDOWS_SDK_LIBS_PATH}/shlwapi.lib
						${WINDOWS_SDK_LIBS_PATH}/mfreadwrite.lib )
						





 